public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}
import java.util.*;
        import java.util.ArrayList;
public class Solution {
    public ArrayList<Integer> FindNumbersWithSum(int [] array,int sum) {
        int left = 0;
        int right = array.length-1;
        ArrayList<Integer> ret = new ArrayList<>();
        while (left<right) {
            if (array[left]+array[right]<sum) {
                left++;
            } else if (array[left]+array[right]>sum) {
                right--;
            } else{
                ret.add(array[left]);
                ret.add(array[right]);
                break;
            }
        }
        return ret;
    }
}